'''
Created on 23.2.2011.

@author: Ana Banana
'''
class Edge:
    """A class representing an edge in the network"""
    def __init__ (self, id, id1, id2):
        self.id = id;
        self.id1 = id1;
        self.id2 = id2;
        
    def getNode1(self, allNodes):
        if allNodes.has_key(self.id1):
            return allNodes[self.id1]
        else:
            print ('No such node in the allNodes dictionary. Id: ', self.id1)
            
    def getNode2(self, allNodes):
        if allNodes.has_key(self.id2):
            return allNodes[self.id2]
        else:
            print ('No such node in the allNodes dictionary. Id: ', self.id2)
        